package com.算法4.base;

/**
 * @description: TODO 类描述
 * @author: YUANG
 * @date: 2022/3/3
 **/
public class RecursionTest {
    public static void main(String[] args) {
        int a = 5;
        int res = recursion(1, a);
        System.out.println(res);
    }

    public static int recursion(int res, int a) {
        if (a <= 1) {
            return res;
        }
        res = res * a--;
        return recursion(res, a);
    }
}
